/**********************************************************
 * File description:currenttime.h
 * Function:获取当前系统时间
 * Current Version: 1.0.0
 * Author: 王伟豪
 * Date: 2022-10-03
 *  -----
 *  Copyright by BoKun Software.
 **********************************************************/

#ifndef CURRENTTIME_H
#define CURRENTTIME_H
#define _CRT_SECURE_NO_WARNINGS 1

#include<QString>
#include<time.h>

class CurrentTime
{
public:
    QString getTime()
    {
        time_t timep;
        time(&timep);
        char tmp[256];
        strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", localtime(&timep));
        return tmp;
    }
};

#endif // CURRENTTIME_H
